<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<!DOCTYPE html>
<html>
<head>
    <title>退换货查询</title>
    <meta content='width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no' name='viewport'/>
    <meta http-equiv="pragma" content="no-cache">
    <meta http-equiv="cache-control" content="no-cache">
    <meta http-equiv="expires" content="0">
    <%@include file="/WEB-INF/pages/common/taglib.jsp" %>
    <%@include file="/WEB-INF/pages/common/common.jsp" %>
</head>
<body>
<div class="content content_frame">
    <h3 class="mainTitle"><img src="${basePath}/images/icon2.png"/>退换货查询</h3>
    </br>
    <ul class="contentNav dib-wrap">
        <li class="dib" id="btnSearch" defaultkey='13'>
            <a><i class='fa fa-search'></i>&nbsp;&nbsp;查&nbsp;询 </a>
        </li>
        <li class="dib ">
            <a onclick="ClearAllInput('SearchTable')">
                <i class='fa fa-refresh'></i>&nbsp;&nbsp;重&nbsp;置 </a>
        </li>
    </ul>
    <br/>
    <table id="SearchTable" width="100%" class="table1">
        <tr>
            <td style="width: 25%;">
                <table width="100%" border="0" cellspacing="10" cellpadding="0">
                    <tr>
                        <td style="width: 50%;">
                            <table width="100%" border="0" cellspacing="10" cellpadding="0">
                                <tr>
                                    <td class="titleCss">
                                        运单号
                                    </td>
                                    <td class="tdCss">
                                        <input type="text" datafield="SearchTable.waybillId"/>
                                    </td>

                                </tr>
                            </table>
                        </td>
                        <td style="width: 50%;">
                            <table width="100%" border="0" cellspacing="10" cellpadding="0">
                                <tr>
                                    <td class="titleCss">
                                        提运单号
                                    </td>
                                    <td class="tdCss">
                                        <input type="text" datafield="SearchTable.billNo"/>
                                    </td>

                                </tr>
                            </table>
                        </td>
                    </tr>
                    <tr>
                        <td style="width: 50%;">
                            <table width="100%" border="0" cellspacing="10" cellpadding="0">
                                <tr>
                                    <td class="titleCss">
                                        收件人姓名
                                    </td>
                                    <td class="tdCss">
                                        <input type="text" datafield="SearchTable.ownerName"/>
                                    </td>

                                </tr>
                            </table>
                        </td>
                        <td style="width: 50%;">
                            <table width="100%" border="0" cellspacing="10" cellpadding="0">
                                <tr>
                                    <td class="titleCss">
                                        申报单位名称
                                    </td>
                                    <td class="tdCss">
                                        <input type="text" datafield="SearchTable.agentName"/>
                                    </td>

                                </tr>
                            </table>
                        </td>
                    </tr>
                    <tr>
                        <td style="width: 50%;">
                            <table width="100%" border="0" cellspacing="10" cellpadding="0">
                                <tr>
                                    <td class="titleCss">
                                        商户名称
                                    </td>
                                    <td class="tdCss">
                                        <input type="text" datafield="SearchTable.ebName"/>
                                    </td>

                                </tr>
                            </table>
                        </td>
                        <td style="width: 50%;">
                            <table width="100%" border="0" cellspacing="10" cellpadding="0">
                                <tr>
                                    <td class="titleCss">
                                        平台名称
                                    </td>
                                    <td class="tdCss">
                                        <input type="text" datafield="SearchTable.ebPlatName"/>
                                    </td>

                                </tr>
                            </table>
                        </td>
                    </tr>
                    <tr>
                        <td style="width: 50%;">
                            <table width="100%" border="0" cellspacing="10" cellpadding="0">
                                <tr>
                                    <td class="titleCss">
                                        物流企业名称
                                    </td>
                                    <td class="tdCss">
                                        <input type="text" datafield="SearchTable.logiEnteName"/>
                                    </td>
                                </tr>
                            </table>
                        </td>
                        <td style="width: 50%;">
                            <table width="100%" border="0" cellspacing="10" cellpadding="0">
                                <tr>
                                    <td class="titleCss">
                                        状态
                                    </td>
                                    <td class="tdCss">
                                        <ui:tsingletableautocomplete
                                            key="ITEM_KEY"
                                            value="ITEM_VALUE"
                                            tableName="DICT_ITEM"
                                            groupId="ORDER_STATUS_QDC"
                                            keyFieldName="status"
                                            valueFieldName="statusXXX"/>
                                    </td>
                                </tr>
                            </table>
                        </td>
                    </tr>
                </table>
            </td>
        </tr>
    </table>
    <div class="cl"></div>
    <br/>
    <table id="corptable">
    </table>
    <div id="corptablePage">
    </div>
</div>
<script type="text/javascript">
    function urlCode(cellvalue, options, rowObject) {
        var url = '${basePath}/declareDetailQdc/declareDetail/' + rowObject.id;
        return "<a class='btn-link' href=\"" + url + "\">" + "<span style='color:#00acec'>"+cellvalue+"</span></a>";
    }
    $(function () {
        $("#corptable").jqGrid({
            datatype: "json",
            url: $basePath + "/searchManage/exchangeSearchQdc/queryExchangeList",
            colNames: [
                'id','状态',
                '运单号',
                '提运单号',
                '申报口岸',
                '出入境时间',
                '收件人姓名',
                '收件人证件号',
                '申报单位名称',
                '商户名称',
                '平台名称',
                '物流企业名称',
                '监管场所名称',
                '启运国',
                '运输方式',
                '运输工具',
                '航次',
                '成交总价',
                '币制',
                '重量',
                '总件数'
            ],
            colModel: [
                {name: 'id', index: 'id', hidden: true},
                {name: 'statusDisplay', index: 'statusDisplay'},
                {name: 'waybillId', index: 'waybillId'},
                {name: 'billNo', index: 'billNo',formatter:urlCode},
                {name: 'declPortDisplay', index: 'declPort'},
                {name: 'ieDate', index: 'ieDate', width: 300},
                {name: 'ownerName', index: 'ownerName'},
                {name: 'ownerCertId', index: 'ownerCertId', width: 300},
                {name: 'agentName', index: 'agentName'},
                {name: 'ebName', index: 'ebName'},
                {name: 'ebPlatName', index: 'ebPlatName'},
                {name: 'logiEnteName', index: 'logiEnteName'},
                {name: 'superPlaceName', index: 'superPlaceName'},
                {name: 'tradeCountDisplay', index: 'tradeCount'},
                {name: 'trafModeDisplay', index: 'trafMode'},
                {name: 'trafName', index: 'trafName'},
                {name: 'voyageNo', index: 'voyageNo'},
                {name: 'transTotalPrice', index: 'transTotalPrice'},
                {name: 'currCodeDisplay', index: 'currCodeDisplay'},
                {name: 'grossWeight', index: 'grossWeight'},
                {name: 'packNum', index: 'packNum'}
            ],
            viewrecords: true,
            autowidth: true,
            height: 'auto',
            shrinkToFit: false,
            autoScroll: true,
            rowNum: 10, //每页显示记录数
            rowList: [10, 20, 100], //可调整每页显示的记录数
//            rownumbers: true,
            rownumWidth: 35,
            multiselect: true,
            width: $('body').width(),
            pager: "#corptablePage", //分页工具栏
            sortname: "id",
            sortorder: "desc",
            loadComplete: function () {
                var rowNum = $(this).jqGrid('getGridParam', 'records');
                if (rowNum <= 0) {
                    if ($(this).parent().children('.norecords').length == 0)
                        $(this).parent().append("<div class=\"norecords\">暂无数据！</div>");
                    $(this).parent().children('.norecords').show();
                }
                else {//如果存在记录，则隐藏提示信息。
                    $(this).parent().children('.norecords').hide();
                }

                $("#corptable").setGridWidth($(window).width() * 0.98);
                $(".ui-jqgrid tr.ui-row-ltr td").css('text-align', 'center');
            }
        });
    });

    function reloadGrid() {
        var jsonStr = customFormToData("SearchTable");
        $("#corptable").jqGrid('setGridParam', {
            url: $basePath + "/searchManage/exchangeSearchQdc/queryExchangeList",
            postData: JSON.parse(jsonStr), //发送数据
            page: 1
        }).trigger("reloadGrid"); //重新载入
    }

    $(function () {
        $("#btnSearch").bind("click", function () {
            reloadGrid();
        });

        $("#btnReset").bind("click", function () {
            document.forms[0].reset();
        });
    });



</script>
</body>
</html>
